<!DOCTYPE html>
<html>

<head>
<title>iframe-dwv</title>
<meta charset="UTF-8">
</head>

<script src="../../../dist/dwv.min.js"></script>

<script type="text/javascript">
tests = [
  {
    setup: function (buffer) {
      return buffer;
    },
    run: function (buffer) {
      // parse the dicom buffer
      var dwvParser = new dwv.DicomParser();
      dwvParser.parse(buffer);
    }
  },
  {
    setup: function (buffer) {
      // parse the dicom buffer
      var dwvParser = new dwv.DicomParser();
      dwvParser.parse(buffer);
      // return
      return [dwvParser.getDicomElements()];
    },
    run: function (input) {
      const elements = input[0];
      // create the image
      const image = dwv.createImage(elements);
      // create the view
      const view = dwv.createView(elements, image);
      // generate image data
      var imgData = new ImageData(256, 256);
      view.generateImageData(imgData);
    }
  }
];
</script>

</html>
